<template>
  <el-container class="boxmain loading">
    <el-header>
      <Head :userinfo="userinfo"></Head>
    </el-header>
    <el-container class="boxsubmain">
      <el-aside width="200px">
        <Menus :userinfo="userinfo"></Menus>
      </el-aside>
      <el-container>
        <el-main>
          <router-view></router-view>
        </el-main>
        <el-footer>
          <Foot />
        </el-footer>
      </el-container>
    </el-container>
  </el-container>
</template>
<script>
// import texiao from "@/views/texiao.vue"
import Head from "@/components/head.vue";
import Foot from "@/components/foot.vue";
import Menus from "@/components/menus.vue";
import { getuserinfo } from "@/api";
export default {
  data() {
    return {
      userinfo: null,
    };
  },
  components: {
    Head,
    Foot,
    Menus,
  },
  mounted() {
    getuserinfo().then((res) => {
      if (res.type) {
        this.userinfo = res.result;
        //记录当前登录的权限
        sessionStorage.setItem("roleid", res.result.roleid);
        sessionStorage.setItem("username", res.result.username);
      }
    });
  },
};
</script>



<style lang="scss">
.el-aside {
  height: 100%;
  //   background: rgb(84, 92, 100);
}
.boxmain {
  width: 100%;
  height: 100%;
  background: url('https://img.pic88.com/preview/2020/08/05/15966341321451224.jpg!s640') no-repeat ;
  background-size: 100% 100%;
}
</style>